//part1:C03:ex3.5.cpp -- input some characters, then concat them to one.
#include <iostream>
#include <string>

int main(void)
{
    using namespace std;
    char tocontinue1 = 'y';
    string s, result;
    cout << "Enter first string:\n";
    while (cin >> s)
    {
        result += s;
        cout << "to continue? (y or n) ?\n";
        cin >> tocontinue1;
        if (tocontinue1 == 'y' || tocontinue1 == 'Y')
        {   
            cout << "Enter the next string:" << endl;
        }
        else
        {
            break;
        }
    }
    cout << "new string is: " << result << endl;
    
    return 0;
}